package lingnan.cn.edu.util;
import java.io.BufferedInputStream;
import java.io.FileInputStream;

import javazoom.jl.player.Player;

public class playMusic {
    private String filename;
    private Player player;

    public playMusic(String filename) {
        this.filename = filename;
    }

    public void play() {
        try {
            BufferedInputStream buffer = new BufferedInputStream(new FileInputStream(filename));
            player = new Player(buffer);
            player.play();

        } catch (Exception e) {
            System.out.println(e);
        }
    }

    public static void main(String[] args) {
        playMusic mp3 = new playMusic("static/sound/10569.mp3");
        mp3.play(); 
    }
}